<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
    <script>
        //编写一个js对象
        var user={
            id:1,
            name:"void",
            age:18
        }
        console.log(user);
        //将js对象转成json对象
        var json = JSON.stringify(user);
        console.log(json);

        //将json对象---->js对象
        var obj = JSON.parse(json);
        console.log("----------------------")
        console.log(obj);
    </script>
</head>
<body>

</body>
</html>